﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Puerts;

public class JsEnvExample8 : MonoBehaviour
{
    public TextAsset textAsset;
    private JsEnv jsEnv;
    // Start is called before the first frame update
    void Start()
    {
        jsEnv = new JsEnv(new DefaultLoader(UnityEngine.Application.dataPath + "/../TsProject/output"), 8282);
        if (textAsset)
        {
            jsEnv.Eval("if(!exports) var exports = {}");
            jsEnv.Eval(textAsset.text);
        }
    }
    // Update is called once per frame
    void Update()
    {
        jsEnv.Tick();
    }
    private void OnDestroy()
    {
        jsEnv.Dispose();
    }
}
